---
title: "Row Dragging"
---

Row dragging is used to rearrange rows by dragging the row with the mouse. To
enable row dragging, set the column property `rowDrag` on one (typically
the first) column.

{% gridExampleRunner title="Row Drag Simple Managed" name="simple-managed" /%}

The example above shows [Managed Row Dragging](./row-dragging-managed), enabled by setting `rowDrag` on the column and `rowDragManaged` on the grid options.

## Enabling Row Dragging

{% apiDocumentation source="column-properties/properties.json" section="row dragging" names=["rowDrag"] /%}

To enable row dragging on all columns, set the column property `rowDrag = true` on one (typically the first) column and configure managed or unmanaged row dragging.

```{% frameworkTransform=true %}
const gridOptions = {
    columnDefs: [
        // make all rows draggable
        { field: 'athlete', rowDrag: true },
    ],
}
```

It is also possible to dynamically control which rows are draggable by providing a callback function as shown below:

```{% frameworkTransform=true %}
const gridOptions = {
    columnDefs: [
        // only allow non-group rows to be dragged
        { field: 'athlete', rowDrag: params => !params.node.group },
    ],
}
```

There are two ways in which row dragging works in the grid, managed and unmanaged:

* **[Managed Row Dragging](./row-dragging-managed)**: This is the simplest, where the grid will rearrange rows as you drag them.
* **[Unmanaged Row Dragging](./row-dragging-unmanaged)**: This is more complex and more powerful. The grid will not rearrange rows as you drag. Instead the application is responsible for responding to events fired by the grid and rows are rearranged by the application.

See also:
- [Row Dragging with Tree Data](./tree-data-row-dragging), both for managed and unmanaged row dragging with [Tree Data](./tree-data/).
- [Row Dragging Between Grids](./row-dragging-to-grid/) to drag rows between two grids.
- [Row Dragging to an External DropZone](./row-dragging-to-external-dropzone/) to drag rows from the grid to an external drop zone.

## Next Up
Continue to the next section to learn about [Managed Row Dragging](./row-dragging-managed).